<?php
$awal = datefmysql($params['awal']);
$akhir = datefmysql($params['akhir']);
$namaFile = 'pemasukan.xls';

header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0,pre-check=0");
header("Content-Type: application/force-download");
header("Content-Type: application/octet-stream");
header("Content-Type: application/download");

// header untuk nama file
header("Content-Disposition: attachment;
                filename=".$namaFile."");

header("Content-Transfer-Encoding: binary ");
?>
<html>
    <head>
        <title>Cetak Laporan Pemasukan</title>
        <link rel="stylesheet" type="text/css" href="<?php echo base_url();?>system/css/style2.css" />
        <link rel="stylesheet" type="text/css" href="<?php echo base_url();?>system/css/tabel.css" />
    </head>
    <body>
    <table border="0">
        <tr bgcolor="#cccccc">
            <td colspan="5" align="center"><strong><font size="+1">Laporan Pemasukan</font></strong></td>
        </tr>
        <tr bgcolor="#cccccc">
            <td colspan="5" align="center"><strong><font size="+1">Periode <?php echo indo_tgl($awal)?> s.d <?php echo indo_tgl($akhir)?></font></strong></td>
        </tr>
    </table>
    <div class="data-list">
        <table class="tabel">
            <tr>
                <th>No</th>
                <th>Petugas</th>
                <th>Tanggal</th>
                <th>Jumlah (Rp.)</th>
                <th>Keterangan</th>
            </tr>
            <?php
              $offsets = isset ($offset)?$offset:0;
              $no = 1 + $offsets;
              foreach ($data as $row){
            ?>
            <tr class="<?php echo ($no%2)?"even":"odd";?>">
                <td style="text-align: center;width: 5%"><?php echo $no++;?></td>
                <td style="width:20%;"><?php echo $row['petugas'];?></td>
                <td style="width:20%;"><?php echo datefmysql($row['tanggal']);?></td>
                <td style="text-align: right;width:20%;"><?php echo rupiah($row['jumlah']);?></td>
                <td><?php echo $row['keterangan'];?></td>
            </tr>
            <?php
              }
            ?>
        </table>
    </div>
    </body>
</html>   
